/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ManagerQuestion.java
 *
 * Created on Apr 5, 2012, 9:07:16 AM
 */
package Admin;

import Constructor.Common;
import DAO.DAO_Answer;
import DAO.DAO_Category_Question;
import DAO.DAO_Question;
import Model.Model_Answer;
import Model.Model_Category_Question;
import Model.Model_Question;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Vector;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

/**
 *
 * @author Admin
 */
public class ManagerQuestion extends javax.swing.JDialog {

    //Khai báo dành cho Tree
    // DefaultMutableTreeNode rootNode;
    // DefaultTreeModel node;
    private DefaultTreeModel treeModel;
    private DefaultMutableTreeNode root;
    private DefaultTableModel modelQuestion = new DefaultTableModel();
    private Vector lVector;
    private String strNode;

    /** Creates new form ManagerQuestion */
    public ManagerQuestion(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        loadFrom();

    }

    private void loadFrom() {
        setTitle("Manager Question");
        this.setSize(950, 540);
        ImageIcon icon = new ImageIcon(getClass().getResource("/Images/logo.png"));
        Image image = icon.getImage();
        setIconImage(image);
        Dimension ScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((ScreenSize.width - 950) / 2, (ScreenSize.height - 540) / 2);
        setResizable(false);
        //setVisible(true);
        createTreeCategory();
        loadTableQuestion();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTreeCategory_Question = new javax.swing.JTree();
        panel1 = new java.awt.Panel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblQuestion = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        butAddQuestion = new javax.swing.JButton();
        butUpdateQuestion = new javax.swing.JButton();
        butDeleteQuestion = new javax.swing.JButton();
        butExit = new javax.swing.JButton();
        jLabel61 = new javax.swing.JLabel();
        butCategoryQuestion = new javax.swing.JButton();
        butUpdateCategory = new javax.swing.JButton();
        butDeleteCategory = new javax.swing.JButton();
        lblChoosecategory = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jTreeCategory_Question.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                jTreeCategory_QuestionValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(jTreeCategory_Question);

        tblQuestion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tblQuestion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblQuestionMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tblQuestion);

        butAddQuestion.setText("Add Question");
        butAddQuestion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butAddQuestionActionPerformed(evt);
            }
        });

        butUpdateQuestion.setText("Update Question");
        butUpdateQuestion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butUpdateQuestionActionPerformed(evt);
            }
        });

        butDeleteQuestion.setText("Delete Question");
        butDeleteQuestion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butDeleteQuestionActionPerformed(evt);
            }
        });

        butExit.setText("Exit");
        butExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butExitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(butAddQuestion, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(54, 54, 54)
                .addComponent(butUpdateQuestion, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(59, 59, 59)
                .addComponent(butDeleteQuestion, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(47, 47, 47)
                .addComponent(butExit, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(butExit)
                    .addComponent(butAddQuestion)
                    .addComponent(butUpdateQuestion)
                    .addComponent(butDeleteQuestion))
                .addContainerGap())
        );

        javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1);
        panel1.setLayout(panel1Layout);
        panel1Layout.setHorizontalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 737, Short.MAX_VALUE))
                .addContainerGap())
        );
        panel1Layout.setVerticalGroup(
            panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jLabel61.setBackground(new java.awt.Color(255, 255, 255));
        jLabel61.setFont(new java.awt.Font("Haettenschweiler", 0, 24));
        jLabel61.setForeground(new java.awt.Color(52, 102, 0));
        jLabel61.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel61.setText("Question");

        butCategoryQuestion.setText("Add Category");
        butCategoryQuestion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butCategoryQuestionActionPerformed(evt);
            }
        });

        butUpdateCategory.setText("Update Category");
        butUpdateCategory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butUpdateCategoryActionPerformed(evt);
            }
        });

        butDeleteCategory.setText("Delete Category");
        butDeleteCategory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butDeleteCategoryActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(butDeleteCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(butCategoryQuestion, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(butUpdateCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(4, 4, 4)
                        .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(lblChoosecategory, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(74, 74, 74)
                        .addComponent(jLabel61, javax.swing.GroupLayout.PREFERRED_SIZE, 491, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(73, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(53, 53, 53)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGap(34, 34, 34)
                                .addComponent(butUpdateCategory)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                                .addComponent(butDeleteCategory))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(butCategoryQuestion)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblChoosecategory)
                            .addComponent(jLabel61, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(panel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(29, 29, 29))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        Common._CategoryID = "";
        Common._AdminQuestion_ID = "";
        Common._Question = "";
        dispose();
    }//GEN-LAST:event_formWindowClosing

    private void butCategoryQuestionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butCategoryQuestionActionPerformed
        // TODO add your handling code here:
        Common._category = "Add";
        CategoryForm frm = new CategoryForm(null, rootPaneCheckingEnabled);
        frm.setVisible(true);
    }//GEN-LAST:event_butCategoryQuestionActionPerformed

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
        // TODO add your handling code here:
        loadFrom();
    }//GEN-LAST:event_formWindowActivated

    private void jTreeCategory_QuestionValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jTreeCategory_QuestionValueChanged
        // TODO add your handling code here:
        DefaultMutableTreeNode slnode = (DefaultMutableTreeNode) evt.getPath().getLastPathComponent();
        strNode = slnode.toString();
        DAO_Category_Question daoCategory = new DAO_Category_Question();
        ArrayList<Model_Category_Question> listCate = daoCategory.getIDCategoryByName(strNode);
        for (Model_Category_Question model_Category_Question : listCate) {
            Common._CategoryID = model_Category_Question.getId();
            if (!Common._CategoryID.equals("0")) {
                DAO_Question question = new DAO_Question();
                loadTableQuestion();
            }
        }
    }//GEN-LAST:event_jTreeCategory_QuestionValueChanged

    private void butUpdateCategoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butUpdateCategoryActionPerformed
        // TODO add your handling code here:
        Common._category = "Update";
        CategoryForm frm = new CategoryForm(null, rootPaneCheckingEnabled);
        frm.setVisible(true);
    }//GEN-LAST:event_butUpdateCategoryActionPerformed

    private void butExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butExitActionPerformed
        // TODO add your handling code here:Common._CategoryID="";
        Common._CategoryID = "";
        Common._AdminQuestion_ID = "";
        Common._Question = "";
        this.setVisible(false);
    }//GEN-LAST:event_butExitActionPerformed

    private void butDeleteCategoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butDeleteCategoryActionPerformed
        // TODO add your handling code here:
        if (JOptionPane.showConfirmDialog(this, "Are you sure removed Category '" + strNode + "'? ") == JOptionPane.YES_OPTION) {
            if (!Common._CategoryID.equals("")) {
                DAO_Category_Question daoCategory = new DAO_Category_Question();
                Integer result = daoCategory.Delete_Category(Common._CategoryID);
                if (result == 1) {
                    Common._CategoryID = "";
                } else {
                    JOptionPane.showConfirmDialog(this, "Error, Can not delete this category, because there were questions in this category! ");
                }
            } else {
                JOptionPane.showConfirmDialog(this, "You do not select the category! ");
            }
        }
    }//GEN-LAST:event_butDeleteCategoryActionPerformed

    private void butAddQuestionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butAddQuestionActionPerformed
        // TODO add your handling code here:
        Common._Question = "Add";
        AddQuestionForm frm = new AddQuestionForm(null, rootPaneCheckingEnabled);
        frm.setVisible(true);

    }//GEN-LAST:event_butAddQuestionActionPerformed

    private void tblQuestionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblQuestionMouseClicked
        // TODO add your handling code here:
        int r = tblQuestion.getSelectedRow();
        if (r < 0) {
            return;
        }
        Common._AdminQuestion_ID = (String) tblQuestion.getValueAt(r, 0);
        Common._CategoryID = (String) tblQuestion.getValueAt(r, 1);
        //JOptionPane.showConfirmDialog(this, Common._Question_ID);
    }//GEN-LAST:event_tblQuestionMouseClicked

    private void butDeleteQuestionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butDeleteQuestionActionPerformed
        // TODO add your handling code here:
        if (JOptionPane.showConfirmDialog(this, "Are you sure removed Question? ") == JOptionPane.YES_OPTION) {
            if ((Integer.parseInt(Common._AdminQuestion_ID) != 0)) {
                DAO_Answer daoAnswer = new DAO_Answer();
                int result1 = daoAnswer.Delete_Answer(Common._AdminQuestion_ID);
                if (result1 == 1) {
                    DAO_Question daoQuestion = new DAO_Question();
                    int result2 = daoQuestion.Delete_Question(Common._AdminQuestion_ID);
                    if (result2 == 1) {
                        Common._AdminQuestion_ID = "";
                        JOptionPane.showConfirmDialog(this, "You deleted a questioned! ");
                    } else {
                        JOptionPane.showConfirmDialog(this, "Error, There can not delete this Question! ");
                    }
                } else {
                    JOptionPane.showConfirmDialog(this, "Error, There can not delete this answers! ");
                }
            } else {
                JOptionPane.showConfirmDialog(this, "You need to select question ! ");
            }
        }
    }//GEN-LAST:event_butDeleteQuestionActionPerformed

    private void butUpdateQuestionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butUpdateQuestionActionPerformed
        // TODO add your handling code here:
        if (Integer.parseInt(Common._AdminQuestion_ID) != 0) {
            Common._Question = "Update";
            AddQuestionForm frm = new AddQuestionForm(null, rootPaneCheckingEnabled);
            frm.setVisible(true);
        } else {
            JOptionPane.showConfirmDialog(this, "You need to select question ! ");
        }
    }//GEN-LAST:event_butUpdateQuestionActionPerformed
// create tree category question

    private void createTreeCategory() {
        //
        root = new DefaultMutableTreeNode("Category");
        treeModel = new DefaultTreeModel(root);
        jTreeCategory_Question.setModel(treeModel);
        //.addTreeSelectionListener(this);
        //connect database 
        DAO_Category_Question dao_Category_Question = new DAO_Category_Question();
        ArrayList<Model_Category_Question> listCategory = dao_Category_Question.getAllCategory();

        for (Model_Category_Question model_Category_Question : listCategory) {
            DefaultMutableTreeNode node = new DefaultMutableTreeNode(model_Category_Question.getName());
            root.add(node);
        }
        jTreeCategory_Question.expandRow(0);
    }

    //Load Question
    private void loadTableQuestion() {
        modelQuestion.setNumRows(0);
        Vector column = new Vector();
        column.add("ID");
        column.add("Category ID");
        column.add("Content Question");
        column.add("option 1");
        column.add("option 2");
        column.add("option 3");
        column.add("option 4");
        column.add("Staus");

        modelQuestion.setColumnIdentifiers(column);
        DAO_Question question = new DAO_Question();
        DAO_Answer daoAnswer = new DAO_Answer();
        if (Common._CategoryID.equals("")) {
            ArrayList<Model_Question> arry = question.get_AllQuestion();
            for (Model_Question model_Question : arry) {
                Vector columnQues = new Vector();
                columnQues.addElement(model_Question.getId());
                columnQues.addElement(model_Question.getCategory_ID());
                columnQues.addElement(model_Question.getContent());

                ArrayList<Model_Answer> modAnswer = new ArrayList<Model_Answer>();
                modAnswer = daoAnswer.get_AnswerbyQuestionID(Integer.parseInt(model_Question.getId()));
                for (Model_Answer model_Answer : modAnswer) {
                    columnQues.addElement((model_Answer.getContent()));
                }
                columnQues.addElement(model_Question.getStatus());
                modelQuestion.addRow(columnQues);
            }
        } else {
            ArrayList<Model_Question> arry = question.getAllQuestionByCateID(Common._CategoryID);
            for (Model_Question model_Question : arry) {
                Vector columnQues = new Vector();
                columnQues.addElement(model_Question.getId());
                columnQues.addElement(model_Question.getCategory_ID());
                columnQues.addElement(model_Question.getContent());

                ArrayList<Model_Answer> modAnswer = new ArrayList<Model_Answer>();
                modAnswer = daoAnswer.get_AnswerbyQuestionID(Integer.parseInt(model_Question.getId()));
                for (Model_Answer model_Answer : modAnswer) {
                    columnQues.addElement((model_Answer.getContent()));
                }
                columnQues.addElement(model_Question.getStatus());
                modelQuestion.addRow(columnQues);
            }
        }
        tblQuestion.setModel(modelQuestion);
        tblQuestion.getColumnModel().getColumn(0).setPreferredWidth(100);
        tblQuestion.getColumnModel().getColumn(1).setPreferredWidth(150);
        tblQuestion.getColumnModel().getColumn(2).setPreferredWidth(550);

        tblQuestion.getColumnModel().getColumn(3).setPreferredWidth(200);
        tblQuestion.getColumnModel().getColumn(4).setPreferredWidth(200);
        tblQuestion.getColumnModel().getColumn(5).setPreferredWidth(200);
        tblQuestion.getColumnModel().getColumn(6).setPreferredWidth(200);

        tblQuestion.getColumnModel().getColumn(7).setPreferredWidth(100);


        //load All Question Where Name
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*  java.awt.EventQueue.invokeLater(new Runnable() {
        
        @Override
        public void run() {
        ManagerQuestion dialog = new ManagerQuestion(new javax.swing.JFrame(), true);
        dialog.addWindowListener(new java.awt.event.WindowAdapter() {
        
        @Override
        public void windowClosing(java.awt.event.WindowEvent e) {
        System.exit(0);
        }
        });
        dialog.setVisible(true);
        }
        });*/
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton butAddQuestion;
    private javax.swing.JButton butCategoryQuestion;
    private javax.swing.JButton butDeleteCategory;
    private javax.swing.JButton butDeleteQuestion;
    private javax.swing.JButton butExit;
    private javax.swing.JButton butUpdateCategory;
    private javax.swing.JButton butUpdateQuestion;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTree jTreeCategory_Question;
    private javax.swing.JLabel lblChoosecategory;
    private java.awt.Panel panel1;
    private javax.swing.JTable tblQuestion;
    // End of variables declaration//GEN-END:variables
}
